Skip to content

Conversation

the-glu
Copy link
Contributor

@the-glu the-glu commented Aug 5, 2025

This PR follow #1094

This replace black and isort by ruff.

For now, it use the default ruff configuration + isort. I do plan to add more rules incrementally when they are useful (e.g. pyupgrade) in separate PR to minimize changes.

It's spited in 4 commits:

  • e55564b Where ruff is configured
  • 40a2a5c Where ruff format is automatically applied
  • b98dfdc For manual changes dues to various errors. I added some comments for the rationale for the fix but I may be wrong, please check it :)
  • f5b0a44 Where ruff is reapplyed on main branch

I also had to apply manual fixes for import (in the second commit) dues to some strange imports of modules / submodules, making some undetected and ruff removing them, but they are 1-1 style-only changes like the rest of the commit.

Mostly tested by the fact that tests are still passing, so parts tests are not done should probably be checked carefully.

@the-glu the-glu force-pushed the ruff branch 4 times, most recently from 2546719 to 55e4d58 Compare August 7, 2025 09:42
@@ -6,7 +6,6 @@
import flask
from implicitdict import ImplicitDict
from loguru import logger
from uas_standards.astm.f3411.v19.api import ErrorResponse
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redefined bellow. I assumed this file version is the one needed ? (message not optional here)

@@ -42,7 +42,7 @@
)
from uas_standards.astm.f3548.v21.constants import Scope

from monitoring.monitorlib import fetch, infrastructure
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defined bellow from fetch.scd (and use scd methods in the file)

@@ -45,7 +45,7 @@ def sub_get_query(
if not fetched_sub.success:
check.record_failed(
summary="Subscription query failed",
details=f"Failed to query subscription {sub_id} referenced by oid {self._oir_a_id} with code {fetched_sub.response.status_code}. Message: {fetched_sub.error_message}",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_oir_a_id is defined in class OIRImplicitSubHandling(TestScenario), I did assumed that the scenario variable

@@ -1128,7 +1128,6 @@ def check_sub_not_none(oir):
check.record_failed(
summary="OIR not attached to any subscription",
details="OIR is not attached to any subscription, when a request for an implicit subscription was made.",
query_timestamps=[mutate_q.timestamp],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably a copy-paste error from others similar methods, I did assume there are no query there.

@@ -39,7 +39,7 @@ def run(self, context):
if not reports:
self.record_note(
"Skip reason",
f"Nominal behavior test scenario report could not be found for any of the scenario types {', '.join(SCENARIO_TYPES)}",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scenario type seems to be a find_test_scenario_reports parameter, who is fixed to NominalBehavior here. Since 'Nominal behavior' is already in the text I just removed it.

@the-glu the-glu marked this pull request as ready for review August 7, 2025 11:36
Copy link
Contributor

@mickmis mickmis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mickmis mickmis merged commit a887683 into interuss:main Aug 18, 2025
21 checks passed
@mickmis mickmis deleted the ruff branch August 18, 2025 08:50
github-actions bot added a commit that referenced this pull request Aug 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants